﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace TFSServices
{
    public partial class BuildStatusControl : UserControl
    {
        public BuildStatusControl()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Scales the control to the specified width
        /// </summary>
        /// <param name="maxControlWidth"></param>
        /// <returns>A <see cref="Double"/> value containing the scale factor</returns>
        public Double Scale(Double maxControlWidth)
        {
            if (maxControlWidth < this.Width)
            {
                BuildStatusTransform.ScaleY = maxControlWidth / this.Width;
                BuildStatusTransform.ScaleX = maxControlWidth / this.Width;

                return maxControlWidth / this.Width;
            }

            return 1;
        }
    }
}
